<%@page import="com.friends.library.Dto.StudentDetail1"%>
<%@page import="java.util.Iterator"%>
<%@page import="org.hibernate.Query"%>
<%@page import="org.hibernate.Transaction"%>
<%@page import="com.friends.library.persistence.HibernateUtil"%>
<%@page import="org.hibernate.Session"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%

 String cardno =request.getParameter("cardno");
   String buffer="";  
   try{
   Session session2=HibernateUtil.getSessionFactory().openSession();
   Transaction transaction=session2.beginTransaction();
   String sql="from StudentDetail1 as detail where detail.cardno=:cardno";
   Query query=session2.createQuery(sql);
   query.setString("cardno",cardno);
   Iterator iterator=query.iterate();
   while(iterator.hasNext()){
   	StudentDetail1 studentDetail1=(StudentDetail1)iterator.next();

   	buffer=":"+studentDetail1.getStudentname()+":"+studentDetail1.getCollegename()+":"+studentDetail1.getSex()+":"+studentDetail1.getCourse()+":"+studentDetail1.getBranch()+":"+studentDetail1.getYear()+":"+studentDetail1.getAddress()+":"+studentDetail1.getCity()+":"+studentDetail1.getZip()+":"+studentDetail1.getEmail()+":"+studentDetail1.getMobile();
   	
   }
 out.println(buffer);
 //System.out.println(buffer);
 }
 catch(Exception e){
 System.out.println(e);
 }
 %>


</body>
</html>